package com.dime.physical.service.impl;

import java.util.List;
import com.ruoyi.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.dime.physical.mapper.DimeInquirydiseaseMapper;
import com.dime.physical.domain.DimeInquirydisease;
import com.dime.physical.service.IDimeInquirydiseaseService;

/**
 * 问诊既往病史Service业务层处理
 * 
 * @author Tiny
 * @date 2023-10-07
 */
@Service
public class DimeInquirydiseaseServiceImpl implements IDimeInquirydiseaseService 
{
    @Autowired
    private DimeInquirydiseaseMapper dimeInquirydiseaseMapper;

    /**
     * 查询问诊既往病史
     * 
     * @param id 问诊既往病史主键
     * @return 问诊既往病史
     */
    @Override
    public DimeInquirydisease selectDimeInquirydiseaseById(String id)
    {
        return dimeInquirydiseaseMapper.selectDimeInquirydiseaseById(id);
    }

    /**
     * 查询问诊既往病史列表
     * 
     * @param dimeInquirydisease 问诊既往病史
     * @return 问诊既往病史
     */
    @Override
    public List<DimeInquirydisease> selectDimeInquirydiseaseList(DimeInquirydisease dimeInquirydisease)
    {
        return dimeInquirydiseaseMapper.selectDimeInquirydiseaseList(dimeInquirydisease);
    }

    /**
     * 新增问诊既往病史
     * 
     * @param dimeInquirydisease 问诊既往病史
     * @return 结果
     */
    @Override
    public int insertDimeInquirydisease(DimeInquirydisease dimeInquirydisease)
    {
        dimeInquirydisease.setCreateTime(DateUtils.getNowDate());
        return dimeInquirydiseaseMapper.insertDimeInquirydisease(dimeInquirydisease);
    }

    /**
     * 修改问诊既往病史
     * 
     * @param dimeInquirydisease 问诊既往病史
     * @return 结果
     */
    @Override
    public int updateDimeInquirydisease(DimeInquirydisease dimeInquirydisease)
    {
        dimeInquirydisease.setUpdateTime(DateUtils.getNowDate());
        return dimeInquirydiseaseMapper.updateDimeInquirydisease(dimeInquirydisease);
    }

    /**
     * 批量删除问诊既往病史
     * 
     * @param ids 需要删除的问诊既往病史主键
     * @return 结果
     */
    @Override
    public int deleteDimeInquirydiseaseByIds(String[] ids)
    {
        return dimeInquirydiseaseMapper.deleteDimeInquirydiseaseByIds(ids);
    }

    /**
     * 删除问诊既往病史信息
     * 
     * @param id 问诊既往病史主键
     * @return 结果
     */
    @Override
    public int deleteDimeInquirydiseaseById(String id)
    {
        return dimeInquirydiseaseMapper.deleteDimeInquirydiseaseById(id);
    }
}
